import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
// import {createStyleImportPlugin} from 'vite-plugin-style-import'
import path from 'path'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    createSvgIconsPlugin({
      iconDirs: [path.resolve(process.cwd(), 'src/icons')],
      // Specify symbolId format
      symbolId: 'icon-[dir]-[name]'
    })
    // createStyleImportPlugin({
    //   libs: [
    //     {
    //       libraryName: 'vxe-table',
    //       esModule: true,
    //       resolveComponent: (name) => `vxe-table/es/${name}`,
    //       resolveStyle: (name) => `vxe-table/es/${name}/style.css`
    //     }
    //   ]
    // })
  ],
  resolve: {
    alias: {
      '@': path.join(__dirname, 'src')
    }
  },
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: '@import "@/styles/variables.scss";'
      }
    }
  }
})
